{% extends "forum_base.html" %}
{% load forum_tags %}
{% load accounts_tags %}
{% load socialaccount %}
{% load recaptcha2 %}
{% block headtitle %}Welcome{% endblock %}



{% block head %}

    {# Load recaptcha #}
    {% recaptcha_init %}

{% endblock %}

{% block content %}

    {% show_messages messages %}

     {% if  social_login %}
        <div class="ui segment inputcolor socialbox">
            <div class="ui header">
                <i class="universal access icon"></i> Automated Signup
            </div>

            <p>
                Select one of the providers to sign up automatically:
            </p>

            <div class="ui large relaxed icon list">
                {% for provider in social_login.iterator %}
                    <a class="item" href="{% provider_login_url provider.provider %}">
                        <i class="{{ provider.name|lower }} large icon"></i>
                        <div class="middle aligned content"> {{ provider.name|title }}</div>

                    </a>
                {% endfor %}
            </div>
            <p>
                Social login is used for authentication only.
            </p>
        </div>
    {% endif %}


        <form method="post" class="ui form attached fluid" action="{% url 'signup' %}">

            {{ form.errors }}


            <div class="ui segment inputcolor socialbox">

                <div class="ui header" >
                     <i class="mail icon"></i> Email Signup
                </div>

                {% form_errors form %}
                <div class="ui basic segment">

                    {% csrf_token %}
                     <div class="field">
                          <label>Email</label>
                          {{ form.email }}
                     </div>

                     <div class="field">
                          <label>Password</label>
                          {{ form.password1 }}
                     </div>

                     <div class="field">
                          <label>Password Confirmation</label>
                          {{ form.password2 }}
                     </div>

                    {% if form.captcha %}
                        <div class="field">
                            <label>Captcha</label>
                            {{form.captcha}}
                        </div>
                    {% endif %}

                    <button type="submit" class="ui primary button"><i class="check icon"></i>Sign up</button>
                    <a class="ui right floated button" href="/"><i class="cancel icon"></i>Cancel</a>

                </div>

            </div>
        </form>



{% endblock %}
